package o;

import android.content.Context;
import android.os.SystemClock;
import com.google.android.exoplayer2.upstream.DataSpec;
import com.google.android.exoplayer2.upstream.HttpDataSource.HttpDataSourceException;
import com.google.android.exoplayer2.upstream.HttpDataSource.InvalidContentTypeException;
import com.google.android.exoplayer2.upstream.HttpDataSource.InvalidResponseCodeException;
import com.google.android.exoplayer2.upstream.HttpDataSource.d;

public class evj extends alp {
    private String ˊ;
    private String ˋ;
    private String ˎ;
    private Context ॱ;

    public evj(String str, ang<String> o_ang_java_lang_String, alx o_alx, int i, int i2, boolean z, d dVar, Context context, String str2, String str3, String str4) {
        super(str, o_ang_java_lang_String, i, i2, z, dVar);
        if (o_alx != null) {
            ॱ(o_alx);
        }
        this.ॱ = context.getApplicationContext();
        this.ˋ = str2;
        this.ˎ = str3;
        this.ˊ = str4;
    }

    public long ˋ(DataSpec dataSpec) throws HttpDataSourceException {
        long elapsedRealtime = SystemClock.elapsedRealtime();
        int ˋॱ = doo.ˋॱ(this.ॱ);
        try {
            long ˋ = super.ˋ(dataSpec);
            esz.ॱ(SystemClock.elapsedRealtime() - elapsedRealtime, ˋॱ, this.ˎ, this.ˋ, this.ˊ);
            return ˋ;
        } catch (HttpDataSourceException e) {
            if ((e instanceof InvalidResponseCodeException) || (e instanceof InvalidContentTypeException)) {
                esv.ॱ(ˋॱ, this.ˎ, this.ˋ, this.ˊ, 1140, e.getMessage());
            } else {
                esv.ॱ(ˋॱ, this.ˎ, this.ˋ, this.ˊ, 1141, e.getMessage());
            }
            throw e;
        }
    }
}
